package com.spring_mysql_redis.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.spring_mysql_redis.entity.Friend;
import com.spring_mysql_redis.entity.Users;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

@Repository
public interface FriendMapper extends BaseMapper<Friend> {

    //先进行用户表和好友表连接，后查询
    @Select("SELECT u.uu_id,u.icon,u.nickname FROM sp_friend f LEFT JOIN sp_user u ON f.friend_uu_id=u.uu_id  WHERE f.user_uu_id = (#{uuId})")
    Page<Users> getFriendList(Page<Users> iPage, String uuId);
}
